export default {
    props: {
        // 主键
        riskListId: {
            type: String,
            default: ''
        },
        // typeList当前item
        typeItem: {
            type: Object,
            default: _ => ({})
        },
        // 接口返回的数据
        typeList: {
            type: Array,
            default: _ => ([])
        },
        // 接口返回的数据
        confList: {
            type: Array,
            default: _ => ([])
        },
        // 接口返回的数据
        valueList: {
            type: Array,
            default: _ => ([])
        },
        // 是否禁用
        disabled: {
            type: Boolean,
            default: false
        }
    },
    data () {
        return {
            // model源
            modelSource: {
                configId: '',
                parentId: '',
                riskListId: '',
                surveyTypeId: '',
                value: '',
                value2: '',
                filedType: '',
                surveyName: '',
                textId: Math.uuid()
            }
        }
    },
    computed: {
        // 组成valueList每项的数组model
        model () {
            if (this.typeItem.filedType == 'input') {
                return this.valueList.find(item => item.surveyTypeId == this.typeItem.surveyTypeId) || this.modelSource
            } else {
                return this.modelSource
            }
        }
    }
}